Skip to main content

Chapter 36 - Migrating State to Terraform Cloud

Move existing state files into TF Cloud

  1. Provision Infra using local backend Notice that you have a local state file and maybe some backups
  2. Destroy or don't destroy it, doesn't matter
  3. Add in your backend block for Terraform Cloud
  4. Login to Terraform Cloud
  5. Run terraform init and it will prompt you to migrate your state to the backend.

image.png 6. State file will now be on the Terraform Cloud Backend 7. Enter in your enviroment variables on the workspace 8. Run terraform plan and terraform apply